<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="Content-Security-Policy" content="default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: blob:">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui, viewport-fit=cover">

  <meta name="theme-color" content="#007aff">
  <meta name="format-detection" content="telephone=no">
  <meta name="msapplication-tap-highlight" content="no">
  <title>Desktop Editor</title>
  
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
  <link rel="apple-touch-icon" href="static/icons/apple-touch-icon.png">
  <link rel="icon" href="static/icons/favicon.png">

    <% if (!htmlWebpackPlugin.options.skeleton.stylesheet) { %>
        <link rel="stylesheet" href="../../common/mobile/resources/css/skeleton.css">
    <% } else { %>
        <style><%= htmlWebpackPlugin.options.skeleton.stylesheet %></style>
    <% } %>
  <!-- built styles file will be auto injected -->
</head>
<body>
    <% if ( htmlWebpackPlugin.options.skeleton.htmlscript ) { %>
    <script>
        window.asceditor = 'word';
        <%= htmlWebpackPlugin.options.skeleton.htmlscript %>
    </script>
    <% } %>
    <% if ( htmlWebpackPlugin.options.skeleton.checkerscript ) { %>
    <script>
        <%= htmlWebpackPlugin.options.skeleton.checkerscript %>
    </script>
    <% } %>
    <section class="skl-container">
        <div class="skl-navbar skl-navbar--word"></div>
        <div class="skl-lines">
            <div class="skl-line"></div>
            <div class="skl-line"></div>
            <div class="skl-line"></div>
        </div>
    </section>
    <script>
        const isAndroid = /Android/.test(navigator.userAgent);
        if ( isAndroid && navigator.platform == 'Win32' )
            // Framework7 doesn't set Device.android flag when navigator.platform == 'Win32', change it for debug
            navigator.__defineGetter__('platform', () => 'Win32Debug');

        const element_add_class = (el, cls) => (el && el.classList.add(cls));

        let navbar = document.querySelector('.skl-navbar');
        if ( window.devicePixelRatio ) {
            element_add_class(navbar, `skl-pixel-ratio--${Math.floor(window.devicePixelRatio)}`);
        }

        if ( !isAndroid ) {
            const ua = navigator.userAgent;
            const iPad = ua.match(/(iPad).*OS\s([\d_]+)/);
            const iPhone = !iPad && ua.match(/(iPhone\sOS|iOS)\s([\d_]+)/);

            if ( !iPad && !iPhone ) {
                Object.defineProperty(navigator, 'userAgent', {
                    get: function () { return `iPad; CPU OS 11_0 ${ua}`; }
                });
            } else {
                element_add_class(navbar, `skl-navbar--ios`);
            }
        } else {
            element_add_class(navbar, `skl-navbar--md`);
        }

        const getUrlParams = () => {
            let e,
                a = /\+/g,  // Regex for replacing addition symbol with a space
                r = /([^&=]+)=?([^&]*)/g,
                d = s => decodeURIComponent(s.replace(a, " ")),
                q = window.location.search.substring(1),
                urlParams = {};

            while (e = r.exec(q))
                urlParams[d(e[1])] = d(e[2]);

            return urlParams;
        };
        function encodeUrlParam(str) {
            return str.replace(/"/g, '&quot;')
                .replace(/'/g, '&#39;')
                .replace(/</g, '&lt;')
                .replace(/>/g, '&gt;');
        }

        window.Common = {Locale: {defaultLang: <%= htmlWebpackPlugin.options.system.env.defaultLang %>}};
        let params = getUrlParams(),
            lang = (params["lang"] || window.Common.Locale.defaultLang).split(/[\-\_]/)[0];

        window.Common.Locale.currentLang = lang;
        window.frameEditorId = params["frameEditorId"];
        window.parentOrigin = params["parentOrigin"];
    </script>

    <script type="text/javascript" src="../../../vendor/jquery/jquery.min.js"></script>

  <div id="app"></div>
  
  <!-- built script files will be auto injected -->

</body>
</html>